import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralCalendarPrivilegeRelation = (params) => {
  params.head.transCode = 'queryGeneralCalendarPrivilegeRelation';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/queryGeneralCalendarPrivilegeRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralCalendarPrivilegeRelationListPage = (params) => {
  params.head.transCode = 'queryGeneralCalendarPrivilegeRelationListPage';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/queryGeneralCalendarPrivilegeRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralCalendarPrivilegeRelation = (params) => {
  params.head.transCode = 'saveGeneralCalendarPrivilegeRelation';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/saveGeneralCalendarPrivilegeRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralCalendarPrivilegeRelationList = (params) => {
  params.head.transCode = 'saveGeneralCalendarPrivilegeRelationList';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/saveGeneralCalendarPrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralCalendarPrivilegeRelation = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralCalendarPrivilegeRelation';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/saveOrUpdateGeneralCalendarPrivilegeRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralCalendarPrivilegeRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralCalendarPrivilegeRelationList';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/saveOrUpdateGeneralCalendarPrivilegeRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralCalendarPrivilegeRelation = (params) => {
  params.head.transCode = 'updateGeneralCalendarPrivilegeRelation';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/updateGeneralCalendarPrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralCalendarPrivilegeRelation = (params) => {
  params.head.transCode = 'deleteGeneralCalendarPrivilegeRelation';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/deleteGeneralCalendarPrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralCalendarPrivilegeRelationList = (params) => {
  params.head.transCode = 'deleteGeneralCalendarPrivilegeRelationList';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/deleteGeneralCalendarPrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralCalendarPrivilegeRelationExcel = (params) => {
  downloadExcel({
    url: '/general/generalCalendarPrivilegeRelation/excelDownload/exportGeneralCalendarPrivilegeRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
//更新日历权限
export const updateCalendarPrivilege = (params) => {
  params.head.transCode = 'updateCalendarPrivilege';
  return request({
    url: '/general/generalCalendarPrivilegeRelation/updateCalendarPrivilege',
    method: 'post',
    data: params
  })
}